package hs.framework.opcClient.framework.util;

import org.springframework.lang.Nullable;

/**
 * @Description TODO
 * @Author sxmz
 * @Date 2021/5/12 0012 上午 11:16
 */
public class NumberUtil {
    public static int toInt(@Nullable final String str, final int defaultValue) {
        if (str == null) {
            return defaultValue;
        } else {
            try {
                return Integer.valueOf(str);
            } catch (NumberFormatException var3) {
                return defaultValue;
            }
        }
    }
}
